package com.hzncc.scaffold.service.impl;

import com.hzncc.scaffold.core.ResultT;
import com.hzncc.scaffold.entity.Other.Industrynews;
import com.hzncc.scaffold.mapper.IndustrynewsMapper;
import com.hzncc.scaffold.service.IndustrynewsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 行业新闻表 服务实现类
 * </p>
 *
 * @author DrunkBear
 * @since 2022-04-27
 */
@Service
public class IndustrynewsServiceImpl extends ServiceImpl<IndustrynewsMapper, Industrynews> implements IndustrynewsService {

    @Autowired
    IndustrynewsService industrynewsService;

    @Override
    public ResultT saveIndustyNews(Industrynews industrynews) {
        boolean save = industrynewsService.save(industrynews);
        if (save) {
            return ResultT.success("保存成功");
        } else {
            return ResultT.fail("保存失败");
        }
    }

    @Override
    public ResultT updateIndustyNews(Industrynews industrynews) {
        boolean update = industrynewsService.updateById(industrynews);
        if(update){
            return ResultT.success("更新成功");
        }else {
            return ResultT.fail("更新失败");
        }
    }
}
